package com.level.system.base;

import java.io.Serializable;
import java.util.Collections;
import java.util.List;
import java.util.Map;

/**
 * 
 * @author zcw
 * @param <T>
 */
@SuppressWarnings("all")
public class PageBean<T> implements Serializable {
    private List<T> records = Collections.emptyList();
    private Map<String, Object> condition;
    private Integer current = 1;
    private Integer size = 10;
    private Integer total = 0;

    public PageBean() {
    }

    public List<T> getRecords() {
        return this.records;
    }

    public void setRecords(List<T> records) {
        this.records = records;
    }

    public Map<String, Object> getCondition() {
        return this.condition;
    }

    public void setCondition(Map<String, Object> condition) {
        this.condition = condition;
    }

    public Integer getCurrent() {
        return this.current;
    }

    public void setCurrent(Integer current) {
        this.current = current;
    }

    public Integer getSize() {
        return this.size;
    }

    public void setSize(Integer size) {
        this.size = size;
    }

    public Integer getTotal() {
        return this.total;
    }

    public void setTotal(Integer total) {
        this.total = total;
    }

    public String toString() {
        return "PageBean{, records=" + this.records + ", condition=" + this.condition + ", current=" + this.current + ", size=" + this.size + ", total=" + this.total + '}';
    }

//    public static Map<String, Object> getPageFilter(PageVo pageVo, Map<String, Object> filter) {
//        if (CheckUtils.isEmpty(filter)) {
//            filter = new HashMap(5);
//        }
//
//        pageVo = initPage(pageVo);
//        ((Map)filter).put("start", pageVo.getCurrent() * pageVo.getSize());
//        ((Map)filter).put("size", pageVo.getSize());
//        return (Map)filter;
//    }
//
//    public static Page coverPage(PageVo pageVo) {
//        return CheckUtils.isNoOneEmpty(new Object[]{pageVo.getCurrent(), pageVo.getSize()}) ? new Page((long)pageVo.getCurrent(), (long)pageVo.getSize()) : null;
//    }
//
    
}
